import React, { PureComponent } from 'react';
import { Text, TouchableOpacity, StyleSheet } from 'react-native';

import { widthScale, heightScale } from '../constants';

export default class Button extends PureComponent {
  render() {
    const { style, titleStyle, title, disabled = false, onPress } = this.props;
    return (
      <TouchableOpacity
        style={[styles.container, style]}
        disabled={disabled}
        onPress={() => {
          onPress && onPress();
        }}
      >
        <Text style={[styles.title, titleStyle]}>{title}</Text>
      </TouchableOpacity>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  title: {
    fontSize: 17,
    color: '#FFFFFF',
  },
});
